import request from '@/utils/request'
// 获取每月薪资超过50%的员工信息
export  function getSalaryOver50perByMonth(query){
  return request({
    url: '/maintainerSalary/getSalaryOver50perByMonth',
    method: 'get',
    params: query
  })
} 


// 按月份获取区域对应的随销及新增达标代维人员人数及总人数占比
export  function salaryRatiosByDistrictAndTime(query){
  return request({
    url: '/maintainerSalary/salaryRatiosByDistrictAndTime',
    method: 'get',
    params: query
  })
} 

// 查询各区县/网格该月的人均激励总额
export  function averageIncentive(query){
  return request({
    url: '/salesIncome/queryTotalIncentiveMonthlyAverage',
    method: 'get',
    params: query
  })
} 
// 查询各区县/网格该月的激励总额
export  function totalIncentive(query){
  return request({
    url: '/salesIncome/queryTotalIncentive',
    method: 'get',
    params: query
  })
} 
// 获取平均随销环比
export function MomSalary(query) {
  return request({
    url: '/salesIncome/getAvgIncentiveMoM',
    method: 'get',
    params: query
  })
}

//  各区县总随销环比
export function totalHbresIncome(query){
  return request({
    url: '/salesIncome/getTotalIncentiveMoM',
    method: 'get',
    params: query
  })
}

// 查询随销收入数据列表
export function listIncome(query) {
  return request({
    url: '/salesIncome/selectIncome',
    method: 'get',
    params: query
  })
}

// 获取区县对应的网格名称
export function getGridName(county) {
  return request({
    url: '/gridManager/getGridName',
    method: 'get',
    params: { county }
  })
}

// 新增随销收入数据
export function addIncome(data) {
  return request({
    url: '/system/income',
    method: 'post',
    data: data
  })
}

// 修改随销收入数据
export function updateIncome(data) {
  return request({
    url: '/system/income',
    method: 'put',
    data: data
  })
}

// 删除随销收入数据
export function delIncome(ids) {
  return request({
    url: `/salesIncome/${ids.join(',')}`,
    method: 'delete'
  })
}

// 上传文件
export function uploadFile(params) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: params,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
export function importIncomeData(params) {
  return request({
    url: '/salesIncome/import',
    method: 'get',
    params
  })
}


